using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VKASZU
    {
        public DataRow Convert2KASZU(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryKASZU(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["KASZMANDANT"] = " ".PadRight(2 ); 
         dwReturn["KASZPROGRP"] = " ".PadRight(3 ); 
         dwReturn["KASZARTGRP"] = " ".PadRight(3 ); 
         dwReturn["KASZKUNDNR"] = " ".PadRight(8 ); 
         dwReturn["KASZWERK"] = " ".PadRight(3 ); 
         dwReturn["KASZABT"] = " ".PadRight(3 ); 
         dwReturn["KASZWAKZ"] = " ".PadRight(1 ); 
         dwReturn["KASZART"] = " ".PadRight(20 ); 
         dwReturn["KASZVAR"] = " ".PadRight(2 ); 
         dwReturn["KASZAENZL"] = " ".PadRight(0 ); 
         dwReturn["KASZAENB"] = " ".PadRight(8 ); 
         dwReturn["KASZAEND"] = " ".PadRight(0 ); 
         dwReturn["KASZNEUB"] = " ".PadRight(8 ); 
         dwReturn["KASZNEUD"] = " ".PadRight(0 ); 
         dwReturn["KASZBBRT01"] = " ".PadRight(0 ); 
         dwReturn["KASZBLG01"] = " ".PadRight(0 ); 
         dwReturn["KASZKOMTR01"] = " ".PadRight(0 ); 
         dwReturn["KASZABF01"] = " ".PadRight(0 ); 
         dwReturn["KASZKSTKRS01"] = " ".PadRight(2 ); 
         dwReturn["KASZKST01"] = " ".PadRight(4 ); 
         dwReturn["KASZBBRT02"] = " ".PadRight(0 ); 
         dwReturn["KASZBLG02"] = " ".PadRight(0 ); 
         dwReturn["KASZKOMTR02"] = " ".PadRight(0 ); 
         dwReturn["KASZABF02"] = " ".PadRight(0 ); 
         dwReturn["KASZKSTKRS02"] = " ".PadRight(2 ); 
         dwReturn["KASZKST02"] = " ".PadRight(4 ); 
         dwReturn["KASZBBRT03"] = " ".PadRight(0 ); 
         dwReturn["KASZBLG03"] = " ".PadRight(0 ); 
         dwReturn["KASZKOMTR03"] = " ".PadRight(0 ); 
         dwReturn["KASZABF03"] = " ".PadRight(0 ); 
         dwReturn["KASZKSTKRS03"] = " ".PadRight(2 ); 
         dwReturn["KASZKST03"] = " ".PadRight(4 ); 
         dwReturn["KASZBBRT04"] = " ".PadRight(0 ); 
         dwReturn["KASZBLG04"] = " ".PadRight(0 ); 
         dwReturn["KASZKOMTR04"] = " ".PadRight(0 ); 
         dwReturn["KASZABF04"] = " ".PadRight(0 ); 
         dwReturn["KASZKSTKRS04"] = " ".PadRight(2 ); 
         dwReturn["KASZKST04"] = " ".PadRight(4 ); 
         dwReturn["KASZBBRT05"] = " ".PadRight(0 ); 
         dwReturn["KASZBLG05"] = " ".PadRight(0 ); 
         dwReturn["KASZKOMTR05"] = " ".PadRight(0 ); 
         dwReturn["KASZABF05"] = " ".PadRight(0 ); 
         dwReturn["KASZKSTKRS05"] = " ".PadRight(2 ); 
         dwReturn["KASZKST05"] = " ".PadRight(4 ); 
         dwReturn["KASZBBRT06"] = " ".PadRight(0 ); 
         dwReturn["KASZBLG06"] = " ".PadRight(0 ); 
         dwReturn["KASZKOMTR06"] = " ".PadRight(0 ); 
         dwReturn["KASZABF06"] = " ".PadRight(0 ); 
         dwReturn["KASZKSTKRS06"] = " ".PadRight(2 ); 
         dwReturn["KASZKST06"] = " ".PadRight(4 ); 
         dwReturn["KASZBBRT07"] = " ".PadRight(0 ); 
         dwReturn["KASZBLG07"] = " ".PadRight(0 ); 
         dwReturn["KASZKOMTR07"] = " ".PadRight(0 ); 
         dwReturn["KASZABF07"] = " ".PadRight(0 ); 
         dwReturn["KASZKSTKRS07"] = " ".PadRight(2 ); 
         dwReturn["KASZKST07"] = " ".PadRight(4 ); 
         dwReturn["KASZBBRT08"] = " ".PadRight(0 ); 
         dwReturn["KASZBLG08"] = " ".PadRight(0 ); 
         dwReturn["KASZKOMTR08"] = " ".PadRight(0 ); 
         dwReturn["KASZABF08"] = " ".PadRight(0 ); 
         dwReturn["KASZKSTKRS08"] = " ".PadRight(2 ); 
         dwReturn["KASZKST08"] = " ".PadRight(4 ); 
         dwReturn["KASZBBRT09"] = " ".PadRight(0 ); 
         dwReturn["KASZBLG09"] = " ".PadRight(0 ); 
         dwReturn["KASZKOMTR09"] = " ".PadRight(0 ); 
         dwReturn["KASZABF09"] = " ".PadRight(0 ); 
         dwReturn["KASZKSTKRS09"] = " ".PadRight(2 ); 
         dwReturn["KASZKST09"] = " ".PadRight(4 ); 
         dwReturn["KASZBBRT10"] = " ".PadRight(0 ); 
         dwReturn["KASZBLG10"] = " ".PadRight(0 ); 
         dwReturn["KASZKOMTR10"] = " ".PadRight(0 ); 
         dwReturn["KASZABF10"] = " ".PadRight(0 ); 
         dwReturn["KASZKSTKRS10"] = " ".PadRight(2 ); 
         dwReturn["KASZKST10"] = " ".PadRight(4 ); 
         dwReturn["KASZBBRT11"] = " ".PadRight(0 ); 
         dwReturn["KASZBLG11"] = " ".PadRight(0 ); 
         dwReturn["KASZKOMTR11"] = " ".PadRight(0 ); 
         dwReturn["KASZABF11"] = " ".PadRight(0 ); 
         dwReturn["KASZKSTKRS11"] = " ".PadRight(2 ); 
         dwReturn["KASZKST11"] = " ".PadRight(4 ); 
         dwReturn["KASZFKOQM"] = " ".PadRight(0 ); 
         dwReturn["KASZFKSTKRS"] = " ".PadRight(2 ); 
         dwReturn["KASZFKST"] = " ".PadRight(4 ); 
         dwReturn["KASZKKOMTR"] = " ".PadRight(0 ); 
         dwReturn["KASZKKSTKRS"] = " ".PadRight(2 ); 
         dwReturn["KASZKKST"] = " ".PadRight(4 ); 
         dwReturn["KASZFILLER"] = " ".PadRight(67 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapKASZU(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveKASZU(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryKASZU(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapKASZU(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertKASZU(dwLocal, ITXDBVERSION);
            }
            UpdateKASZU(dwLocal);
        }
        public void InsertKASZU(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO KASZU(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryKASZU(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM KASZU WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM KASZU  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "KASZU";
            Return = Result;
            return Return;
        }
        public void DeleteKASZU(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM KASZU   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateKASZU(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE KASZU SET "
                    +"KASZMANDANT= :KASZMANDANT,"
                    +"KASZPROGRP= :KASZPROGRP,"
                    +"KASZARTGRP= :KASZARTGRP,"
                    +"KASZKUNDNR= :KASZKUNDNR,"
                    +"KASZWERK= :KASZWERK,"
                    +"KASZABT= :KASZABT,"
                    +"KASZWAKZ= :KASZWAKZ,"
                    +"KASZART= :KASZART,"
                    +"KASZVAR= :KASZVAR,"
                    +"KASZAENZL= :KASZAENZL,"
                    +"KASZAENB= :KASZAENB,"
                    +"KASZAEND= :KASZAEND,"
                    +"KASZNEUB= :KASZNEUB,"
                    +"KASZNEUD= :KASZNEUD,"
                    +"KASZBBRT01= :KASZBBRT01,"
                    +"KASZBLG01= :KASZBLG01,"
                    +"KASZKOMTR01= :KASZKOMTR01,"
                    +"KASZABF01= :KASZABF01,"
                    +"KASZKSTKRS01= :KASZKSTKRS01,"
                    +"KASZKST01= :KASZKST01,"
                    +"KASZBBRT02= :KASZBBRT02,"
                    +"KASZBLG02= :KASZBLG02,"
                    +"KASZKOMTR02= :KASZKOMTR02,"
                    +"KASZABF02= :KASZABF02,"
                    +"KASZKSTKRS02= :KASZKSTKRS02,"
                    +"KASZKST02= :KASZKST02,"
                    +"KASZBBRT03= :KASZBBRT03,"
                    +"KASZBLG03= :KASZBLG03,"
                    +"KASZKOMTR03= :KASZKOMTR03,"
                    +"KASZABF03= :KASZABF03,"
                    +"KASZKSTKRS03= :KASZKSTKRS03,"
                    +"KASZKST03= :KASZKST03,"
                    +"KASZBBRT04= :KASZBBRT04,"
                    +"KASZBLG04= :KASZBLG04,"
                    +"KASZKOMTR04= :KASZKOMTR04,"
                    +"KASZABF04= :KASZABF04,"
                    +"KASZKSTKRS04= :KASZKSTKRS04,"
                    +"KASZKST04= :KASZKST04,"
                    +"KASZBBRT05= :KASZBBRT05,"
                    +"KASZBLG05= :KASZBLG05,"
                    +"KASZKOMTR05= :KASZKOMTR05,"
                    +"KASZABF05= :KASZABF05,"
                    +"KASZKSTKRS05= :KASZKSTKRS05,"
                    +"KASZKST05= :KASZKST05,"
                    +"KASZBBRT06= :KASZBBRT06,"
                    +"KASZBLG06= :KASZBLG06,"
                    +"KASZKOMTR06= :KASZKOMTR06,"
                    +"KASZABF06= :KASZABF06,"
                    +"KASZKSTKRS06= :KASZKSTKRS06,"
                    +"KASZKST06= :KASZKST06,"
                    +"KASZBBRT07= :KASZBBRT07,"
                    +"KASZBLG07= :KASZBLG07,"
                    +"KASZKOMTR07= :KASZKOMTR07,"
                    +"KASZABF07= :KASZABF07,"
                    +"KASZKSTKRS07= :KASZKSTKRS07,"
                    +"KASZKST07= :KASZKST07,"
                    +"KASZBBRT08= :KASZBBRT08,"
                    +"KASZBLG08= :KASZBLG08,"
                    +"KASZKOMTR08= :KASZKOMTR08,"
                    +"KASZABF08= :KASZABF08,"
                    +"KASZKSTKRS08= :KASZKSTKRS08,"
                    +"KASZKST08= :KASZKST08,"
                    +"KASZBBRT09= :KASZBBRT09,"
                    +"KASZBLG09= :KASZBLG09,"
                    +"KASZKOMTR09= :KASZKOMTR09,"
                    +"KASZABF09= :KASZABF09,"
                    +"KASZKSTKRS09= :KASZKSTKRS09,"
                    +"KASZKST09= :KASZKST09,"
                    +"KASZBBRT10= :KASZBBRT10,"
                    +"KASZBLG10= :KASZBLG10,"
                    +"KASZKOMTR10= :KASZKOMTR10,"
                    +"KASZABF10= :KASZABF10,"
                    +"KASZKSTKRS10= :KASZKSTKRS10,"
                    +"KASZKST10= :KASZKST10,"
                    +"KASZBBRT11= :KASZBBRT11,"
                    +"KASZBLG11= :KASZBLG11,"
                    +"KASZKOMTR11= :KASZKOMTR11,"
                    +"KASZABF11= :KASZABF11,"
                    +"KASZKSTKRS11= :KASZKSTKRS11,"
                    +"KASZKST11= :KASZKST11,"
                    +"KASZFKOQM= :KASZFKOQM,"
                    +"KASZFKSTKRS= :KASZFKSTKRS,"
                    +"KASZFKST= :KASZFKST,"
                    +"KASZKKOMTR= :KASZKKOMTR,"
                    +"KASZKKSTKRS= :KASZKKSTKRS,"
                    +"KASZKKST= :KASZKKST,"
                    +"KASZFILLER= :KASZFILLER,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("KASZMANDANT", OracleType.NVarChar).Value = dwData["KASZMANDANT"].ToString(); 
          or1.Parameters.Add("KASZPROGRP", OracleType.NVarChar).Value = dwData["KASZPROGRP"].ToString(); 
          or1.Parameters.Add("KASZARTGRP", OracleType.NVarChar).Value = dwData["KASZARTGRP"].ToString(); 
          or1.Parameters.Add("KASZKUNDNR", OracleType.NVarChar).Value = dwData["KASZKUNDNR"].ToString(); 
          or1.Parameters.Add("KASZWERK", OracleType.NVarChar).Value = dwData["KASZWERK"].ToString(); 
          or1.Parameters.Add("KASZABT", OracleType.NVarChar).Value = dwData["KASZABT"].ToString(); 
          or1.Parameters.Add("KASZWAKZ", OracleType.NVarChar).Value = dwData["KASZWAKZ"].ToString(); 
          or1.Parameters.Add("KASZART", OracleType.NVarChar).Value = dwData["KASZART"].ToString(); 
          or1.Parameters.Add("KASZVAR", OracleType.NVarChar).Value = dwData["KASZVAR"].ToString(); 
          or1.Parameters.Add("KASZAENZL", OracleType.NVarChar).Value = dwData["KASZAENZL"].ToString(); 
          or1.Parameters.Add("KASZAENB", OracleType.NVarChar).Value = dwData["KASZAENB"].ToString(); 
          or1.Parameters.Add("KASZAEND", OracleType.NVarChar).Value = dwData["KASZAEND"].ToString(); 
          or1.Parameters.Add("KASZNEUB", OracleType.NVarChar).Value = dwData["KASZNEUB"].ToString(); 
          or1.Parameters.Add("KASZNEUD", OracleType.NVarChar).Value = dwData["KASZNEUD"].ToString(); 
          or1.Parameters.Add("KASZBBRT01", OracleType.NVarChar).Value = dwData["KASZBBRT01"].ToString(); 
          or1.Parameters.Add("KASZBLG01", OracleType.NVarChar).Value = dwData["KASZBLG01"].ToString(); 
          or1.Parameters.Add("KASZKOMTR01", OracleType.NVarChar).Value = dwData["KASZKOMTR01"].ToString(); 
          or1.Parameters.Add("KASZABF01", OracleType.NVarChar).Value = dwData["KASZABF01"].ToString(); 
          or1.Parameters.Add("KASZKSTKRS01", OracleType.NVarChar).Value = dwData["KASZKSTKRS01"].ToString(); 
          or1.Parameters.Add("KASZKST01", OracleType.NVarChar).Value = dwData["KASZKST01"].ToString(); 
          or1.Parameters.Add("KASZBBRT02", OracleType.NVarChar).Value = dwData["KASZBBRT02"].ToString(); 
          or1.Parameters.Add("KASZBLG02", OracleType.NVarChar).Value = dwData["KASZBLG02"].ToString(); 
          or1.Parameters.Add("KASZKOMTR02", OracleType.NVarChar).Value = dwData["KASZKOMTR02"].ToString(); 
          or1.Parameters.Add("KASZABF02", OracleType.NVarChar).Value = dwData["KASZABF02"].ToString(); 
          or1.Parameters.Add("KASZKSTKRS02", OracleType.NVarChar).Value = dwData["KASZKSTKRS02"].ToString(); 
          or1.Parameters.Add("KASZKST02", OracleType.NVarChar).Value = dwData["KASZKST02"].ToString(); 
          or1.Parameters.Add("KASZBBRT03", OracleType.NVarChar).Value = dwData["KASZBBRT03"].ToString(); 
          or1.Parameters.Add("KASZBLG03", OracleType.NVarChar).Value = dwData["KASZBLG03"].ToString(); 
          or1.Parameters.Add("KASZKOMTR03", OracleType.NVarChar).Value = dwData["KASZKOMTR03"].ToString(); 
          or1.Parameters.Add("KASZABF03", OracleType.NVarChar).Value = dwData["KASZABF03"].ToString(); 
          or1.Parameters.Add("KASZKSTKRS03", OracleType.NVarChar).Value = dwData["KASZKSTKRS03"].ToString(); 
          or1.Parameters.Add("KASZKST03", OracleType.NVarChar).Value = dwData["KASZKST03"].ToString(); 
          or1.Parameters.Add("KASZBBRT04", OracleType.NVarChar).Value = dwData["KASZBBRT04"].ToString(); 
          or1.Parameters.Add("KASZBLG04", OracleType.NVarChar).Value = dwData["KASZBLG04"].ToString(); 
          or1.Parameters.Add("KASZKOMTR04", OracleType.NVarChar).Value = dwData["KASZKOMTR04"].ToString(); 
          or1.Parameters.Add("KASZABF04", OracleType.NVarChar).Value = dwData["KASZABF04"].ToString(); 
          or1.Parameters.Add("KASZKSTKRS04", OracleType.NVarChar).Value = dwData["KASZKSTKRS04"].ToString(); 
          or1.Parameters.Add("KASZKST04", OracleType.NVarChar).Value = dwData["KASZKST04"].ToString(); 
          or1.Parameters.Add("KASZBBRT05", OracleType.NVarChar).Value = dwData["KASZBBRT05"].ToString(); 
          or1.Parameters.Add("KASZBLG05", OracleType.NVarChar).Value = dwData["KASZBLG05"].ToString(); 
          or1.Parameters.Add("KASZKOMTR05", OracleType.NVarChar).Value = dwData["KASZKOMTR05"].ToString(); 
          or1.Parameters.Add("KASZABF05", OracleType.NVarChar).Value = dwData["KASZABF05"].ToString(); 
          or1.Parameters.Add("KASZKSTKRS05", OracleType.NVarChar).Value = dwData["KASZKSTKRS05"].ToString(); 
          or1.Parameters.Add("KASZKST05", OracleType.NVarChar).Value = dwData["KASZKST05"].ToString(); 
          or1.Parameters.Add("KASZBBRT06", OracleType.NVarChar).Value = dwData["KASZBBRT06"].ToString(); 
          or1.Parameters.Add("KASZBLG06", OracleType.NVarChar).Value = dwData["KASZBLG06"].ToString(); 
          or1.Parameters.Add("KASZKOMTR06", OracleType.NVarChar).Value = dwData["KASZKOMTR06"].ToString(); 
          or1.Parameters.Add("KASZABF06", OracleType.NVarChar).Value = dwData["KASZABF06"].ToString(); 
          or1.Parameters.Add("KASZKSTKRS06", OracleType.NVarChar).Value = dwData["KASZKSTKRS06"].ToString(); 
          or1.Parameters.Add("KASZKST06", OracleType.NVarChar).Value = dwData["KASZKST06"].ToString(); 
          or1.Parameters.Add("KASZBBRT07", OracleType.NVarChar).Value = dwData["KASZBBRT07"].ToString(); 
          or1.Parameters.Add("KASZBLG07", OracleType.NVarChar).Value = dwData["KASZBLG07"].ToString(); 
          or1.Parameters.Add("KASZKOMTR07", OracleType.NVarChar).Value = dwData["KASZKOMTR07"].ToString(); 
          or1.Parameters.Add("KASZABF07", OracleType.NVarChar).Value = dwData["KASZABF07"].ToString(); 
          or1.Parameters.Add("KASZKSTKRS07", OracleType.NVarChar).Value = dwData["KASZKSTKRS07"].ToString(); 
          or1.Parameters.Add("KASZKST07", OracleType.NVarChar).Value = dwData["KASZKST07"].ToString(); 
          or1.Parameters.Add("KASZBBRT08", OracleType.NVarChar).Value = dwData["KASZBBRT08"].ToString(); 
          or1.Parameters.Add("KASZBLG08", OracleType.NVarChar).Value = dwData["KASZBLG08"].ToString(); 
          or1.Parameters.Add("KASZKOMTR08", OracleType.NVarChar).Value = dwData["KASZKOMTR08"].ToString(); 
          or1.Parameters.Add("KASZABF08", OracleType.NVarChar).Value = dwData["KASZABF08"].ToString(); 
          or1.Parameters.Add("KASZKSTKRS08", OracleType.NVarChar).Value = dwData["KASZKSTKRS08"].ToString(); 
          or1.Parameters.Add("KASZKST08", OracleType.NVarChar).Value = dwData["KASZKST08"].ToString(); 
          or1.Parameters.Add("KASZBBRT09", OracleType.NVarChar).Value = dwData["KASZBBRT09"].ToString(); 
          or1.Parameters.Add("KASZBLG09", OracleType.NVarChar).Value = dwData["KASZBLG09"].ToString(); 
          or1.Parameters.Add("KASZKOMTR09", OracleType.NVarChar).Value = dwData["KASZKOMTR09"].ToString(); 
          or1.Parameters.Add("KASZABF09", OracleType.NVarChar).Value = dwData["KASZABF09"].ToString(); 
          or1.Parameters.Add("KASZKSTKRS09", OracleType.NVarChar).Value = dwData["KASZKSTKRS09"].ToString(); 
          or1.Parameters.Add("KASZKST09", OracleType.NVarChar).Value = dwData["KASZKST09"].ToString(); 
          or1.Parameters.Add("KASZBBRT10", OracleType.NVarChar).Value = dwData["KASZBBRT10"].ToString(); 
          or1.Parameters.Add("KASZBLG10", OracleType.NVarChar).Value = dwData["KASZBLG10"].ToString(); 
          or1.Parameters.Add("KASZKOMTR10", OracleType.NVarChar).Value = dwData["KASZKOMTR10"].ToString(); 
          or1.Parameters.Add("KASZABF10", OracleType.NVarChar).Value = dwData["KASZABF10"].ToString(); 
          or1.Parameters.Add("KASZKSTKRS10", OracleType.NVarChar).Value = dwData["KASZKSTKRS10"].ToString(); 
          or1.Parameters.Add("KASZKST10", OracleType.NVarChar).Value = dwData["KASZKST10"].ToString(); 
          or1.Parameters.Add("KASZBBRT11", OracleType.NVarChar).Value = dwData["KASZBBRT11"].ToString(); 
          or1.Parameters.Add("KASZBLG11", OracleType.NVarChar).Value = dwData["KASZBLG11"].ToString(); 
          or1.Parameters.Add("KASZKOMTR11", OracleType.NVarChar).Value = dwData["KASZKOMTR11"].ToString(); 
          or1.Parameters.Add("KASZABF11", OracleType.NVarChar).Value = dwData["KASZABF11"].ToString(); 
          or1.Parameters.Add("KASZKSTKRS11", OracleType.NVarChar).Value = dwData["KASZKSTKRS11"].ToString(); 
          or1.Parameters.Add("KASZKST11", OracleType.NVarChar).Value = dwData["KASZKST11"].ToString(); 
          or1.Parameters.Add("KASZFKOQM", OracleType.NVarChar).Value = dwData["KASZFKOQM"].ToString(); 
          or1.Parameters.Add("KASZFKSTKRS", OracleType.NVarChar).Value = dwData["KASZFKSTKRS"].ToString(); 
          or1.Parameters.Add("KASZFKST", OracleType.NVarChar).Value = dwData["KASZFKST"].ToString(); 
          or1.Parameters.Add("KASZKKOMTR", OracleType.NVarChar).Value = dwData["KASZKKOMTR"].ToString(); 
          or1.Parameters.Add("KASZKKSTKRS", OracleType.NVarChar).Value = dwData["KASZKKSTKRS"].ToString(); 
          or1.Parameters.Add("KASZKKST", OracleType.NVarChar).Value = dwData["KASZKKST"].ToString(); 
          or1.Parameters.Add("KASZFILLER", OracleType.NVarChar).Value = dwData["KASZFILLER"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
